﻿namespace Sample.JQuery {
	using System;
	using System.Web;
	using System.Web.UI;

	public partial class DialogPage : Page {

		protected override void OnLoad(System.EventArgs e) {
			base.OnLoad(e);

			ServerOpenButton.Click += new EventHandler(ServerOpenButton_Click);
			ServerCloseButton.Click += new EventHandler(ServerCloseButton_Click);

			if(!IsPostBack) {
				HttpBrowserCapabilities browser = Request.Browser;
				if(browser.Browser == "IE" && browser.MajorVersion < 7) Dialog.BgIFrame = true;
			}
		}

		private void ServerCloseButton_Click(object sender, EventArgs e) {
			Dialog.Close();
		}

		private void ServerOpenButton_Click(object sender, EventArgs e) {
			Dialog.Open();
		}

	}

}